package com.shfl.servermanage.logic.service.impl;

import com.github.pagehelper.PageInfo;
import com.shfl.servermanage.logic.bean.SysReleaseLog;
import com.shfl.servermanage.logic.mapper.SysReleaseLogMapper;
import com.shfl.servermanage.logic.model.response.SysReleaseLogPageResponse;
import com.shfl.servermanage.logic.service.SysReleaseLogServer;
import com.shfl.servermanage.pagehelper.PageHelperUtils;
import com.shfl.servermanage.pagehelper.Pageable;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Map;

@Service
public class SysReleaseLogServerImpl implements SysReleaseLogServer {

    @Autowired
    private SysReleaseLogMapper sysReleaseLogMapper;

    @Override
    @Transactional(rollbackFor = Exception.class)
    public int insertSelective(SysReleaseLog record) {
        return sysReleaseLogMapper.insertSelective(record);
    }

    @Override
    public PageInfo<SysReleaseLogPageResponse> findPage(Pageable pageable, Map<String, Object> objectMap) {
        PageHelperUtils.startPageWithCount(pageable);
        return new PageInfo<>(sysReleaseLogMapper.findPage(objectMap));
    }
}
